<?php

namespace App\Jobs;

use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;

class SendFangownerMail implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
    //成员属性
    private $model;

    public function __construct($model)
    {
        $this->model = $model;
    }

    //执行任务方法
    public function handle()
    {
        $fangowner = $this->model;
        Mail::raw('您的信息在本平台添加成功', function (Message $message) use ($fangowner) {
            $message->to($fangowner->email, $fangowner->name);
            $message->subject('添加成功通知');
        });
    }
}
